package com.java.basis.thread.n8.pool;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * newSingleThreadExecutor
 *
 * @author wangning
 * @create 2022-02-09 16:32
 */
@Slf4j(topic = "c.TestThreadPoolExecutors03")
public class TestThreadPoolExecutors03 {
	public static void main(String[] args) {
		test02();
	}

	private static void test02() {
		ExecutorService pool = Executors.newSingleThreadExecutor();
		pool.execute(() -> {
			log.debug("1");
			int i = 1 / 0;
		});

		pool.execute(() -> {
			log.debug("2");
		});
		pool.execute(() -> {
			log.debug("3");
		});

	}

	private static void test01() {

	}

}
